$(function () {
    /*原登记界面js*/
    $.ajax({
        url: "/phyDept",
        type: "GET",
        contentType: "application/json;charset=utf-8",
        dataType: "json",
        success: function (data) {
            var deptDiv = $("#dept-info");
            $.each(data, function (index, ele) {
                var $deptItem = $("<div class=\"layui-col-md6\">\n" +
                    "            <div class=\"layui-card\">\n" +
                    "                <div class=\"layui-card-header\">体检信息</div>\n" +
                    "                <div class=\"layui-card-body\">\n" +
                    "                    <p>学院名称："+ele.deptName+"</p>\n" +
                    "                    <p>体检人数："+ele.stuCount+"</p>\n" +
                    "                </div>\n" +
                    "            </div>\n" +
                    "        </div>");
                deptDiv.append($deptItem);
            });
            var countDiv = $("#count-information");
            var $count = $("" + "<span style=\"padding-right: 40px\"> 已体检学院个数："+data.length+"</span>");
            countDiv.append($count);
            $.ajax({
                url: "/phyStu",
                type: "GET",
                dataType: "json",
                contentType: "application/json;charset=utf-8",
                success: function (data) {
                    var countDiv = $("#count-information");
                    $count = $("" + "<span> 体检总人数："+data.length+"</span>");
                    countDiv.append($count);
                },
                error: function () {
                    alert("error");
                }
            });
        },
        error: function () {
            alert("error");
        }
    });


});